<?php
namespace app\index\controller;

use app\common\model\user\Users;

class Phpqrcode
{
	// 二维码
	public function qrcode($url)
	{
		if(is_numeric($url)){
			$user = Users::get($url);
			$url = 'http://'.$_SERVER['HTTP_HOST']."/index/web/index/tjuser/{$user->no}";
		}
		$level = 3;
		$size = 4;
		$errorCorrectionLevel = intval($level);//容错级别
		$matrixPointSize = intval($size);//生成图片大小
		//    生成二维码图片
		\PHPQRCode\QRcode::png($url, false, $errorCorrectionLevel, $matrixPointSize, 2);
		exit;
	}
	
}